#lang racket


(require "../base/main.rkt")

(require "domain.rkt"
         "skin.rkt")


(provide (struct-out plane-skin)
         plane-skin-object
         plane-skin-tangent
         plane-skin-normal
         plane-skin-binormal
         make-plane-skin)


(define-struct (plane-skin skin)
  ()
  #:constructor-name new-plane-skin)

(define (plane-skin-object)
  (λ (u v)
    (xyz u v 0)))

(define (plane-skin-tangent)
  (λ (u v)
    (list ux uy)))

(define (plane-skin-normal)
  (λ (u v)
    uz))

(define (plane-skin-binormal)
  skin-binormal)

(define (make-plane-skin)
  (new-plane-skin
   (plane-skin-object)
   (plane-skin-tangent)
   (plane-skin-normal)
   (plane-skin-binormal)
   (make-uv-domain 'closed (- 1) 'closed 1 'closed (- 1) 'closed 1)))